FROM python:3.12

#RUN sed -i 's/archive.ubuntu.com/mirrors.aliyun.com/g' /etc/apt/sources.list
#RUN sed -i 's/security.ubuntu.com/mirrors.aliyun.com/g' /etc/apt/sources.list
# 设置为中国国内源
#RUN sed -i 's/deb.debian.org/mirrors.ustc.edu.cn/g' /etc/apt/sources.list
#RUN sed -i 's/security.debian.org/mirrors.ustc.edu.cn/g' /etc/apt/sources.list

#RUN apt-get update && apt-get install -y \
#    pkg-config \
#    libmysqlclient-dev \
#    build-essential

WORKDIR /app

COPY requirements.txt .
RUN python -m pip install --upgrade pip || true
RUN pip install -r requirements.txt -i https://mirrors.aliyun.com/pypi/simple/

COPY . .
EXPOSE 5000
CMD ["python", "main.py"]